package com.xhsj.user.hr.process.hrEntryProcess.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xhsj.user.hr.process.dto.hrEntryProcess.MyEntryApplyListDto;
import com.xhsj.user.hr.process.dto.hrEntryProcess.RunEntryApplyListDto;
import com.xhsj.user.hr.process.hrEntryProcess.entity.TbHrApprovalEntryApply;
import com.xhsj.user.hr.process.hrEntryProcess.query.CompletedEntryApplyQuery;
import com.xhsj.user.hr.process.hrEntryProcess.query.MyEntryApplyListQuery;
import com.xhsj.user.hr.process.hrEntryProcess.query.RunEntryApplyListQuery;
import com.xhsj.user.hr.system.vo.MonthCountVo;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * <p>
 * hr流程-入职申请表 Mapper 接口
 * </p>
 *
 * @author liuqinghua
 * @since 2020-09-07
 */
@Mapper
public interface TbHrApprovalEntryApplyMapper extends BaseMapper<TbHrApprovalEntryApply> {

    /**
     * 我的入职申请列表
     * @author liuqinghua
     * @date Sep 1, 2020 10:07:11 AM
     */
    Page<MyEntryApplyListQuery> myEntryApplyList(Page<MyEntryApplyListQuery> page,
                                                 @Param("userId") Long userId,
                                                 @Param("data") MyEntryApplyListDto data);

    /**
     * 待审核入职申请列表
     * @author liuqinghua
     * @date Sep 1, 2020 10:07:11 AM
     */
    Page<RunEntryApplyListQuery> runEntryApplyList(Page<RunEntryApplyListQuery> page,
                                                   @Param("userId") Long userId,
                                                   @Param("roleList") List<Long> roleList,
                                                   @Param("data") RunEntryApplyListDto data);

    /**
     * 已审核入职申请列表
     * @author liuqinghua
     * @date Sep 1, 2020 10:07:11 AM
     */
    Page<CompletedEntryApplyQuery> completedEntryApplyList(Page<CompletedEntryApplyQuery> page,
                                                           @Param("userId") Long userId,
                                                           @Param("data") RunEntryApplyListDto data);

    /**
     * 删除入职申请基本数据
     * @author liuqinghua
     * @date Sep 1, 2020 10:07:11 AM
     */
    int deleteMyEntryApply(@Param("dataId") Long dataId);


    /**
     * 查询每月入职人数
     * @author 苏小林
     * @date 2020/9/14 15:54
     * @param: date
     * @return: java.util.List<com.xhsj.user.hr.system.vo.MonthCountVo>
     */
    List<MonthCountVo> getCountByDate(@Param("date") String date);

    /**
     * 查询入职时间
     * @author 苏小林
     * @date 2020/9/15 10:41
     * @param: userId
     * @return: java.lang.String
     */
    String findArrivalDate(@Param("userId") Long userId);

    /**
     * 通过手机号查询数据
     * @author 苏小林
     * @date 2021/7/15 17:13
     * @param: phoneNumber
     * @return: com.xhsj.user.hr.process.hrEntryProcess.entity.TbHrApprovalEntryApply
     */
    TbHrApprovalEntryApply getByPhoneNumber(@Param("phoneNumber") String phoneNumber);

    /**
     * 查询用户入职时间
     * @author 苏小林
     * @date 2021/8/9 17:31
     * @param: userId
     * @return: java.lang.String
     */
    String getArrivalDateByUserId(@Param("userId") Long userId);
   /**
       * @Description:  查询当月入职人数-截至到今天
       * @Author: liuqinghua
       * @Date: 2021/9/9
       */
   MonthCountVo getCunrrentCountByDate();

    TbHrApprovalEntryApply getByIdCard(@Param("idCard") String idCard);

    TbHrApprovalEntryApply getByBankAccount(@Param("bankAccount") String bankAccount);
}
